import 'package:trade/common/base/view_model.dart';
import 'package:trade/data/apis/login_api.dart';
import 'package:trade/data/model/user_model.dart';
import 'package:trade/widgets/loading/loading_util.dart';

class LoginModel extends ViewModel {
  Future<bool> login({required String phone, required String password,required UserModel userModel}) async {
    showLoading();
    var result = await LoginApi(phone: phone, password: password,userModel:userModel).request();
    dismissLoading();
    var msg = result.msg;
    if (msg != null) {
      showToast(msg);
      return Future.value(false);
    } else {
      return Future.value(true);
    }
  }
}
